/**
* Copyright (C) qzgf, 2012
*
* License        :Apache License 2.0
* Project        :qzgfjava
* Package        :com.qzgf.application.BaseAction;
* File	         :BaseAction
* Written by     :fjfdszj
* Created Date   :May 21, 2012
* Purpose        :用户session基类

======================================

* Modifyer by    :fjfdszj
* Update Date    :May 21, 2012
* Purpose        :描述

*/


package com.qzgf.application;

import java.lang.reflect.Method;
import java.util.HashMap;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class BaseAction extends ActionSupport {

	private String action = "Index";//默认action值
	
	public String viewjson = "json";//针对action的返回值为json时的处理
	public String json = "";

	@SuppressWarnings("unchecked")
	public HashMap search = new HashMap();
	
	/**
	 * 默认构造函数
	 */
	public BaseAction(){
		
	}
	
    /**
     * 
     * Purpose      :反射执行相关action方法
     * @param method
     * @return
     * @throws Exception
     */
	@SuppressWarnings("unchecked")
	protected String execute(String method) throws Exception {
		Class[] c = null;
		Method m = this.getClass().getMethod(method, c);
		Object[] o = null;
		String result = (String) m.invoke(this, o);
		return result;
	}
	
	//================================================================================	
	//================================================================================
	//==============================基本参数设置======================================
	//================================================================================
	//================================================================================
	/**
	 * Purpose      : 说明
	 * @return the json
	 */
	public String getJson() {
		return json;
	}


	/**
	 * Purpose      : 说明
	 * @param json the json to set
	 */
	
	public void setJson(String json) {
		this.json = json;
	}



	@SuppressWarnings("unchecked")
	public HashMap getSearch() {
		return search;
	}

	@SuppressWarnings("unchecked")
	public void setSearch(HashMap search) {
		this.search = search;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	
	
}
